
<!DOCTYPE html>
<html lang="en" class="loading">
<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>TCP/IP--分用 - Hexo</title>
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <meta name="google" content="notranslate" />
    <meta name="keywords" content="Fechin,"> 
    <meta name="description" content="1.3 分用当目的主机收到一个以太网数据帧的时候，数据就开始从协议栈中自底向上升，同时去掉各层协议加上的报文首部。
每层协议盒都要去检查报文首部中的协议标识，以确定接收数据的上层协议。这个过程就叫分,"> 
    <meta name="author" content="John Doe"> 
    <link rel="alternative" href="atom.xml" title="Hexo" type="application/atom+xml"> 
    <link rel="icon" href="/yi-mark-gitee-io/img/favicon.png"> 
    
    
    
    <meta name="twitter:card" content="summary"/>
    <meta name="twitter:title" content="TCP/IP--分用 - Hexo"/>
    <meta name="twitter:description" content="1.3 分用当目的主机收到一个以太网数据帧的时候，数据就开始从协议栈中自底向上升，同时去掉各层协议加上的报文首部。
每层协议盒都要去检查报文首部中的协议标识，以确定接收数据的上层协议。这个过程就叫分,"/>
    
    
    
    
    <meta property="og:site_name" content="Hexo"/>
    <meta property="og:type" content="object"/>
    <meta property="og:title" content="TCP/IP--分用 - Hexo"/>
    <meta property="og:description" content="1.3 分用当目的主机收到一个以太网数据帧的时候，数据就开始从协议栈中自底向上升，同时去掉各层协议加上的报文首部。
每层协议盒都要去检查报文首部中的协议标识，以确定接收数据的上层协议。这个过程就叫分,"/>
    
<link rel="stylesheet" href="/yi-mark-gitee-io/css/diaspora.css">

<meta name="generator" content="Hexo 6.0.0"></head>

<body class="loading">
    <span id="config-title" style="display:none">Hexo</span>
    <div id="loader"></div>
    <div id="single">
    <div id="top" style="display: block;">
    <div class="bar" style="width: 0;"></div>
    <a class="iconfont icon-home image-icon" href="javascript:;" data-url="https://yi-mark.gitee.io"></a>
    <div title="播放/暂停" class="iconfont icon-play"></div>
    <h3 class="subtitle">TCP/IP--分用</h3>
    <div class="social">
        <div>
            <div class="share">
                <a title="获取二维码" class="iconfont icon-scan" href="javascript:;"></a>
            </div>
            <div id="qr"></div>
        </div>
    </div>
    <div class="scrollbar"></div>
</div>

    <div class="section">
        <div class="article">
    <div class='main'>
        <h1 class="title">TCP/IP--分用</h1>
        <div class="stuff">
            <span>二月 04, 2022</span>
            
  <ul class="post-tags-list" itemprop="keywords"><li class="post-tags-list-item"><a class="post-tags-list-link" href="/yi-mark-gitee-io/tags/TCP-IP/" rel="tag">TCP&#x2F;IP</a></li></ul>


        </div>
        <div class="content markdown">
            <h2 id="1-3-分用"><a href="#1-3-分用" class="headerlink" title="1.3 分用"></a>1.3 分用</h2><p>当目的主机收到一个以太网数据帧的时候，数据就开始从协议栈中自底向上升，同时去掉各层协议加上的报文首部。</p>
<p>每层协议盒都要去检查报文首部中的协议标识，以确定接收数据的上层协议。这个过程就叫<strong>分用（Demultiplexing）</strong></p>
<p><img src="https://s2.loli.net/2022/02/04/BsVeaPcHSGLtpjX.png" alt="image-20220204211001171"></p>
<blockquote>
<p>因为IP协议、ARP协议、RARP协议都使用帧来传输数据，所以帧的头部需要提供某个字段（具体情况取决于帧的类型）来区分他们。 以以太网帧为例，它使用两个字节的类型字段来标识上层协议。如果主机接收到的以太网帧类型字段的值为0x800,则帧的数据部分为<strong>IP数据报</strong>，以太网驱动就将帧交付给IP模块；若类型值为0x835，则帧的数据部分为<strong>ARP请求或应答报文</strong>，以太网驱动程序就将帧交付给ARP模块；</p>
</blockquote>
<blockquote>
<p>同样，因为ICMP协议，TCP协议，UDP协议都使用IP协议，所以IP数据报的头部采用16位的协议字段来区分它们</p>
</blockquote>
<blockquote>
<p>TCP报文段和UDP数据报则通过其头部中的16位的端口号字段来区分上层应用程序。    </p>
</blockquote>

            <!--[if lt IE 9]><script>document.createElement('audio');</script><![endif]-->
            <audio id="audio" loop="1" preload="auto" controls="controls" data-autoplay="false">
                <source type="audio/mpeg" src="">
            </audio>
            
                <ul id="audio-list" style="display:none">
                    
                        
                            <li title="0" data-url="http://link.hhtjim.com/163/425570952.mp3"></li>
                        
                    
                        
                            <li title="1" data-url="http://link.hhtjim.com/163/425570952.mp3"></li>
                        
                    
                </ul>
            
        </div>
        
    <div id="gitalk-container" class="comment link"
		data-enable="false"
        data-ae="false"
        data-ci=""
        data-cs=""
        data-r=""
        data-o=""
        data-a=""
        data-d="false"
    >查看评论</div>


    </div>
    
</div>


    </div>
</div>
</body>


<script src="//lib.baomitu.com/jquery/1.8.3/jquery.min.js"></script>
<script src="/yi-mark-gitee-io/js/plugin.js"></script>
<script src="/yi-mark-gitee-io/js/typed.js"></script>
<script src="/yi-mark-gitee-io/js/diaspora.js"></script>


<link rel="stylesheet" href="/yi-mark-gitee-io/photoswipe/photoswipe.css">
<link rel="stylesheet" href="/yi-mark-gitee-io/photoswipe/default-skin/default-skin.css">


<script src="/yi-mark-gitee-io/photoswipe/photoswipe.min.js"></script>
<script src="/yi-mark-gitee-io/photoswipe/photoswipe-ui-default.min.js"></script>


<!-- Root element of PhotoSwipe. Must have class pswp. -->
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">
    <!-- Background of PhotoSwipe. 
         It's a separate element as animating opacity is faster than rgba(). -->
    <div class="pswp__bg"></div>
    <!-- Slides wrapper with overflow:hidden. -->
    <div class="pswp__scroll-wrap">
        <!-- Container that holds slides. 
            PhotoSwipe keeps only 3 of them in the DOM to save memory.
            Don't modify these 3 pswp__item elements, data is added later on. -->
        <div class="pswp__container">
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
        </div>
        <!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
        <div class="pswp__ui pswp__ui--hidden">
            <div class="pswp__top-bar">
                <!--  Controls are self-explanatory. Order can be changed. -->
                <div class="pswp__counter"></div>
                <button class="pswp__button pswp__button--close" title="Close (Esc)"></button>
                <button class="pswp__button pswp__button--share" title="Share"></button>
                <button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>
                <button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>
                <!-- Preloader demo http://codepen.io/dimsemenov/pen/yyBWoR -->
                <!-- element will get class pswp__preloader--active when preloader is running -->
                <div class="pswp__preloader">
                    <div class="pswp__preloader__icn">
                      <div class="pswp__preloader__cut">
                        <div class="pswp__preloader__donut"></div>
                      </div>
                    </div>
                </div>
            </div>
            <div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
                <div class="pswp__share-tooltip"></div> 
            </div>
            <button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
            </button>
            <button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
            </button>
            <div class="pswp__caption">
                <div class="pswp__caption__center"></div>
            </div>
        </div>
    </div>
</div>






</html>
